import React from 'react';
import BaseTabBar from '@/components/layout/baseTabBar';
import { IRouteComponentProps } from 'umi';

// 比如：Cart  Login  Product  Users不需要布局
// Mine OrderList Home这三个页面需要布局

let layoutPage: Array<string> = ['/mine', '/orderlist', '/home'];

export default function ({ children, location }: IRouteComponentProps) {
  let isLayoutPage: boolean = layoutPage.includes(location.pathname);

  if (isLayoutPage) {
    return <BaseTabBar>{children}</BaseTabBar>;
  }

  return children;
}
